package com.culture.bootdemo;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.retry.annotation.EnableRetry;
import org.springframework.scheduling.annotation.EnableAsync;

import java.util.Arrays;

@SpringBootApplication
@EnableRetry //重试机制
//@EnableAsync
@MapperScan("com.culture.bootdemo.dao") //设置mapper接口的扫描包,默认自动扫描yml文件，若多数据源，可去掉该配置，在具体配置类中配置
public class BootdemoApplication {

    //监控页面：http://localhost/bootDemo/druid/index.html
    public static void main(String[] args) {
        SpringApplication.run(BootdemoApplication.class, args);
    }

    //打印spring自动注入bean
    /*@Bean
	public CommandLineRunner commandLineRunner(ApplicationContext ctx) {
		return args -> {

			System.out.println("Let's inspect the beans provided by Spring Boot:");

			String[] beanNames = ctx.getBeanDefinitionNames();
			Arrays.sort(beanNames);
			for (String beanName : beanNames) {
				System.out.println(beanName);
			}

		};
	}*/

}
